/**
 * 
 */
package org.mytool.common.db;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.mytool.cache.CacheKey;

import javax.sql.DataSource;

/**
 * @author wangchen
 *        
 */
public interface TableInfoI
{
    // public void setConnInfo(String url, String username, String password) throws SQLException ;
    
//    public void setConnection(Connection connection);

    public void setDataSource(DataSource dataSource);
    
    public Connection getConnection();
    
    public List<String> getTables()
        throws SQLException;
        
    public List<ColumnData> getColumnDatas(String tableName)
        throws SQLException;
        
    public String db2JavaType(String dataType, String precision, String scale);
    
    public String getTablesNameToClassName(String tableName);
    
    public Map<String, Object> getAutoCreateSql(String tableName)
        throws Exception;
        
    public String getDeleteSql(String tableName, String[] columnsList)
        throws SQLException;
        
    public String getUpdateSql(String tableName, String[] columnsList)
        throws SQLException;
    
    public void setDbNameByUrl(String url);
        
}
